function out = cachedPhi0(r, r_, theta )
%CACHEDPHI0 Summary of this function goes here
%   Detailed explanation goes here

% Use global parameter:
global h_theta;
global h_r;
global phi0_cache;

i = round(1.0 + (theta ./ h_theta));
if (theta == pi)
    i = i + 1;
end
j = round(1.0 + (r_ ./ h_r));
k = round(1.0 + (r ./ h_r));

out = phi0_cache(i, j, k);

end

